<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>switch语句</title>
	</head>
	<body>
		<script type="text/javascript">
			var weather = 'rainy';
			
			switch(weather){
				case 'sunny':
					// statements_1
					alert(1);
					break;
				case 'rainy':
					alert(2);
					// 编写switch语句,小心break,cash穿透.
					 break;
					编写switch语句为啥不行呢?
				case 'snowing':
					// statements_2
					alert(3);
					break;
				default:
				// statements_def
					alert(4);
					break;
			}
		</script>
	</body>
</html>
